local PANEL = {}

function PANEL:Init()
	
	self.Items = {}
	
end

function PANEL:AddItem( tbl )

	local panel = vgui.Create("UpgradesItem")
	
	panel:SetTable( tbl )
	
	table.insert( self.Items, panel )

end

function PANEL:Paint()
	draw.RoundedBox( 8, 0,0, self:GetWide(), self:GetTall() )
end

function PANEL:PerformLayout()

	local MinWidth = CommUpgrade:GetWide()
	local CurX = 1
	
	for _, v in pairs( self.Items ) do
	
		v:SetSize( 148, 148 )
		v:SetPos( CurX, 1 )
		
		CurX = CurX + v:GetWide() + 2
	
	end
	
	self:SetWide( math.max( MinWidth, CurX ) )

end


vgui.Register( "UpgradesList", PANEL )